home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
separate.lqr
/
separate.lbr
/
convrt.doc
next >
Wrap
Text File
|
2011-02-04
|
2KB
|
60 lines
{----------------------------------------------------------------
This is an example of an external and the program that
calls it.
----------------------------------------------------------------}
{
PROGRAM callable;
TYPE
string80 = string[ 80 ];
PROCEDURE UpShift( var buffer : string80 );
VAR
i : integer;
BEGIN
For i := 1 to length( buffer ) Do
buffer[ i ] := Upcase( buffer[ i ] );
END;
BEGIN
END.
}
{----------------------------------------------------------------
This is the calling program.
----------------------------------------------------------------}
PROGRAM testload;
TYPE
str80 = string[ 80 ];
VAR
buffer : str80;
{$ILOADER.INC} { This is the loader that changes the jump }
{ table in the external subprogram }
PROCEDURE UpShift( var buffer : str80 ); external 'call.com';
BEGIN
Load( ofs( Upshift )); { Set up the jump table }
WRITELN; WRITELN;
buffer := 'hello';
writeln( buffer );
Upshift( buffer ); { Call the external procedure }
writeln( buffer ); { Check to see if it worked }
END.
Note : To get CONVERT.PAS to run, it is absolutely necessary to be sure that
the CONST LibrarySize is set to the end address of the Turbo run-time
library (see consideration #4 of the opening comments of program
CONVERT.PAS found in file CONVRT.PAS). If the address for the
implementation you have is not listed, you can find it by using DEBUG
to look at TURBO.COM or a .COM file generated by it. The first command
in the file is a JMP to the desired address. Record that and use it as
the value of LibrarySize in program CONVERT.PAS.
While ( temp <> nil ) and ( i <= numcalls ) Do
Begin
If (( temp^.byte_val = $E8 ) or ( temp^.by